package junit;

import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;

/**
 * @author 阳十三
 * @email wdful165177@gmail.com
 * @blog http://www.item1024.com
 * @date 2017/8/24
 */

public class OthersTest extends BaseJunitTest {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;
    //redis测试
    @Test
    public void test01(){
        ValueOperations<String, String> lop = redisTemplate.opsForValue();
        lop.set("lmy", "测试单个值");
        lop.set("lmy","测试修改");
        System.out.println(lop.get("lmy"));

    }
    @Test
    public void test02(){
        ListOperations<String,String> loop = redisTemplate.opsForList();
        loop.leftPush("01","001");
        loop.leftPush("01","002");
        loop.leftPush("01","003");
        loop.leftPush("01","004");
    }
}
